package gui;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.KeyEvent;

import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
import javax.swing.LayoutStyle;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

import controller.BtnCertificateBrowseAction;
import controller.BtnDecryptAction;
import controller.BtnEncryptAction;
import controller.BtnInputBrowseEncAction;
import controller.BtnInputCertBrowseAction;
import controller.BtnOutputBrowseEncAction;
import controller.BtnOutputCertBrowseAction;
import controller.BtnPrivateKeyBrowseAction;

/**
 * @author hqthai01 Jan 2, 2015
 */
public class Main extends JFrame {
	private static final long serialVersionUID = 0x3AE1;
	private JButton btnCertificateBrowse;
	private JButton btnDecrypt;
	private JButton btnEncrypt;
	private JButton btnInputBrowseEnc;
	private JButton btnInputCertBrowse;
	private JButton btnOutputBrowseEnc;
	private JButton btnOutputCertBrowse;
	private JButton btnPrivateKeyBrowse;
	private JLabel lblCertificate;
	private JLabel lblInputCert;
	private JLabel lblInputEnc;
	private JLabel lblOutputCertBrowse;
	private JLabel lblOutputEnc;
	private JLabel lblPassword;
	private JLabel lblPrivateKey;
	private JMenu mnHelp;
	private JMenuBar mnbar;
	private JMenuItem mniAbout;
	private JMenuItem mniHelpContents;
	private JPanel pnListProcessDec;
	private JPanel pnListProcessEnc;
	private JPanel pn_decrypt;
	private JPanel pn_encrypt;
	private JPanel pn_top_decrypt;
	private JPanel pn_top_encrypt;
	private JScrollPane scrollDec;
	private JScrollPane scrollEnc;
	private JTabbedPane tabpane;
	private JTextField tfCertificate;
	private JTextField tfInputCert;
	private JTextField tfInputEnc;
	private JTextField tfOutputCertBrowse;
	private JTextField tfOutputEnc;
	private JPasswordField tfPassword;
	private JTextField tfPrivateKey;

	private GridLayout grid_enc;
	private GridLayout grid_dec;

	public Main() {
		initComponents();
	}

	private void newComps() {
		tabpane = new JTabbedPane();
		pn_encrypt = new JPanel();
		pn_top_encrypt = new JPanel();
		lblPrivateKey = new JLabel();
		tfPrivateKey = new JTextField();
		btnPrivateKeyBrowse = new JButton();
		lblPassword = new JLabel();
		tfPassword = new JPasswordField();
		btnEncrypt = new JButton();
		lblInputEnc = new JLabel();
		tfInputEnc = new JTextField();
		btnInputBrowseEnc = new JButton();
		lblOutputEnc = new JLabel();
		tfOutputEnc = new JTextField();
		btnOutputBrowseEnc = new JButton();
		scrollEnc = new JScrollPane();
		pnListProcessEnc = new JPanel();
		pn_decrypt = new JPanel();
		pn_top_decrypt = new JPanel();
		lblCertificate = new JLabel();
		tfCertificate = new JTextField();
		btnCertificateBrowse = new JButton();
		btnDecrypt = new JButton();
		lblInputCert = new JLabel();
		tfInputCert = new JTextField();
		btnInputCertBrowse = new JButton();
		lblOutputCertBrowse = new JLabel();
		tfOutputCertBrowse = new JTextField();
		btnOutputCertBrowse = new JButton();
		scrollDec = new JScrollPane();
		pnListProcessDec = new JPanel();
		mnbar = new JMenuBar();
		mnHelp = new JMenu();
		mniHelpContents = new JMenuItem();
		mniAbout = new JMenuItem();

		grid_enc = new GridLayout(1, 1);
		grid_dec = new GridLayout(1, 1);
	}

	private void setCompsProperties() {
		pn_top_encrypt.setBorder(BorderFactory.createTitledBorder(""));
		lblPrivateKey.setText("PrivateKey file");
		btnPrivateKeyBrowse.setText("Browse");
		lblPassword.setText("Password");
		btnEncrypt.setText("Encrypt");
		lblInputEnc.setText("File(s) input");
		btnInputBrowseEnc.setText("Browse");
		lblOutputEnc.setText("Output folder");
		btnOutputBrowseEnc.setText("Browse");

		scrollEnc.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		scrollEnc.setToolTipText("");

		pnListProcessEnc.setBackground(Color.black);
		pnListProcessEnc.setMinimumSize(new Dimension(542, 0));
		pnListProcessEnc.setLayout(null);
		scrollEnc.setViewportView(pnListProcessEnc);

		pn_top_decrypt.setBorder(BorderFactory.createTitledBorder(""));
		lblCertificate.setText("Certificate file");
		btnCertificateBrowse.setText("Browse");
		btnDecrypt.setText("Decrypt");
		lblInputCert.setText("File(s) input");
		btnInputCertBrowse.setText("Browse");
		lblOutputCertBrowse.setText("Output folder");
		btnOutputCertBrowse.setText("Browse");

		scrollDec.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		scrollDec.setToolTipText("");

		pnListProcessDec.setBackground(Color.black);
		pnListProcessDec.setMinimumSize(new Dimension(542, 0));
		pnListProcessDec.setLayout(null);
		scrollDec.setViewportView(pnListProcessDec);

		mnHelp.setText("Help");

		mniHelpContents.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
		mniHelpContents.setText("Help Contents");
		mnHelp.add(mniHelpContents);

		mniAbout.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
		mniAbout.setText("About");
		mnHelp.add(mniAbout);

		mnbar.add(mnHelp);

		setJMenuBar(mnbar);
	}

	private void setPnTopEncLayout() {
		GroupLayout pn_top_encryptLayout = new GroupLayout(pn_top_encrypt);
		pn_top_encrypt.setLayout(pn_top_encryptLayout);
		pn_top_encryptLayout.setHorizontalGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				pn_top_encryptLayout
						.createSequentialGroup()
						.addContainerGap()
						.addGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(lblPrivateKey).addComponent(lblPassword).addComponent(lblInputEnc)
								.addComponent(lblOutputEnc))
						.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(pn_top_encryptLayout
								.createParallelGroup(GroupLayout.Alignment.LEADING)
								.addGroup(pn_top_encryptLayout.createSequentialGroup().addComponent(tfInputEnc, GroupLayout.PREFERRED_SIZE, 226, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnInputBrowseEnc, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE))
								.addGroup(pn_top_encryptLayout.createSequentialGroup().addComponent(tfOutputEnc, GroupLayout.PREFERRED_SIZE, 211, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(btnOutputBrowseEnc, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
								.addGroup(pn_top_encryptLayout.createSequentialGroup().addComponent(tfPrivateKey, GroupLayout.PREFERRED_SIZE, 230, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(btnPrivateKeyBrowse, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
								.addComponent(tfPassword, GroupLayout.PREFERRED_SIZE, 330, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
						.addComponent(btnEncrypt, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addContainerGap()));

		pn_top_encryptLayout.linkSize(SwingConstants.HORIZONTAL, new Component[] { tfInputEnc, tfOutputEnc, tfPrivateKey });

		pn_top_encryptLayout.linkSize(SwingConstants.HORIZONTAL, new Component[] { btnInputBrowseEnc, btnOutputBrowseEnc, btnPrivateKeyBrowse });

		pn_top_encryptLayout
				.setVerticalGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
						pn_top_encryptLayout
								.createSequentialGroup()
								.addGap(7, 7, 7)
								.addGroup(pn_top_encryptLayout
										.createParallelGroup(GroupLayout.Alignment.LEADING)
										.addGroup(pn_top_encryptLayout
												.createSequentialGroup()
												.addGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
														.addComponent(lblPrivateKey, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
														.addComponent(tfPrivateKey, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
														.addComponent(btnPrivateKeyBrowse))
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lblPassword)
														.addComponent(tfPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lblInputEnc)
														.addComponent(tfInputEnc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
														.addComponent(btnInputBrowseEnc))
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addGroup(pn_top_encryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lblOutputEnc)
														.addComponent(tfOutputEnc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
														.addComponent(btnOutputBrowseEnc)).addGap(0, 0, Short.MAX_VALUE))
										.addComponent(btnEncrypt, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap()));
	}

	private void setPnEncLayout() {
		GroupLayout pn_encryptLayout = new GroupLayout(pn_encrypt);
		pn_encrypt.setLayout(pn_encryptLayout);
		pn_encryptLayout.setHorizontalGroup(pn_encryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				GroupLayout.Alignment.TRAILING,
				pn_encryptLayout
						.createSequentialGroup()
						.addContainerGap()
						.addGroup(pn_encryptLayout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(scrollEnc)
								.addComponent(pn_top_encrypt, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap()));
		pn_encryptLayout.setVerticalGroup(pn_encryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				pn_encryptLayout.createSequentialGroup().addGap(10, 10, 10).addComponent(pn_top_encrypt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(scrollEnc, GroupLayout.PREFERRED_SIZE, 270, GroupLayout.PREFERRED_SIZE)
						.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

		if(!System.getProperty("os.name").toLowerCase().contains("windows"))
			tabpane.addTab("ENCRYPTER", pn_encrypt);
	}

	private void setPnTopDecLayout() {
		GroupLayout pn_top_decryptLayout = new GroupLayout(pn_top_decrypt);
		pn_top_decrypt.setLayout(pn_top_decryptLayout);
		pn_top_decryptLayout
				.setHorizontalGroup(pn_top_decryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
						pn_top_decryptLayout
								.createSequentialGroup()
								.addContainerGap()
								.addGroup(pn_top_decryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(lblCertificate).addComponent(lblInputCert)
										.addComponent(lblOutputCertBrowse))
								.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(pn_top_decryptLayout
										.createParallelGroup(GroupLayout.Alignment.LEADING)
										.addGroup(pn_top_decryptLayout.createSequentialGroup().addComponent(tfInputCert, GroupLayout.PREFERRED_SIZE, 226, GroupLayout.PREFERRED_SIZE)
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addComponent(btnInputCertBrowse, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE))
										.addGroup(pn_top_decryptLayout.createSequentialGroup().addComponent(tfOutputCertBrowse, GroupLayout.PREFERRED_SIZE, 211, GroupLayout.PREFERRED_SIZE)
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addComponent(btnOutputCertBrowse, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE))
										.addGroup(pn_top_decryptLayout.createSequentialGroup().addComponent(tfCertificate, GroupLayout.PREFERRED_SIZE, 230, GroupLayout.PREFERRED_SIZE)
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addComponent(btnCertificateBrowse, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE)))
								.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnDecrypt, GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE).addContainerGap()));

		pn_top_decryptLayout.linkSize(SwingConstants.HORIZONTAL, new Component[] { tfCertificate, tfInputCert, tfOutputCertBrowse });

		pn_top_decryptLayout.linkSize(SwingConstants.HORIZONTAL, new Component[] { btnCertificateBrowse, btnInputCertBrowse, btnOutputCertBrowse });

		pn_top_decryptLayout.setVerticalGroup(pn_top_decryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				pn_top_decryptLayout
						.createSequentialGroup()
						.addContainerGap()
						.addGroup(pn_top_decryptLayout
								.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
								.addComponent(btnDecrypt, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addGroup(GroupLayout.Alignment.LEADING,
										pn_top_decryptLayout
												.createSequentialGroup()
												.addGroup(pn_top_decryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
														.addComponent(lblCertificate, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
														.addComponent(tfCertificate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
														.addComponent(btnCertificateBrowse))
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addGroup(pn_top_decryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lblInputCert)
														.addComponent(tfInputCert, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
														.addComponent(btnInputCertBrowse))
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addGroup(pn_top_decryptLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lblOutputCertBrowse)
														.addComponent(tfOutputCertBrowse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
														.addComponent(btnOutputCertBrowse)))).addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
	}

	private void setPnDecLayout() {
		GroupLayout pn_decryptLayout = new GroupLayout(pn_decrypt);
		pn_decrypt.setLayout(pn_decryptLayout);
		pn_decryptLayout.setHorizontalGroup(pn_decryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				pn_decryptLayout
						.createSequentialGroup()
						.addContainerGap()
						.addGroup(pn_decryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
								.addComponent(pn_top_decrypt, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addComponent(scrollDec, GroupLayout.Alignment.TRAILING)).addContainerGap()));
		pn_decryptLayout.setVerticalGroup(pn_decryptLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(
				pn_decryptLayout.createSequentialGroup().addContainerGap().addComponent(pn_top_decrypt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(scrollDec, GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE).addContainerGap()));

		tabpane.addTab("DECRYPTER", pn_decrypt);
	}

	private void setMainLayout() {
		setTitle("Encrypter and Decrypter");
		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		setIconImage(new ImageIcon("src/icons/keys-icon.png").getImage());
		setMinimumSize(new Dimension(580, 400));
		setResizable(false);

		GroupLayout layout = new GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(tabpane));
		layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(tabpane));

	}

	private void setPnListProcLayout() {
		grid_dec.setRows(10);
		pnListProcessDec.setLayout(grid_dec);

		grid_enc.setRows(9);
		pnListProcessEnc.setLayout(grid_enc);
	}

	private void initComponents() {
		newComps();
		setCompsProperties();
		setPnTopEncLayout();
		setPnEncLayout();
		setPnTopDecLayout();
		setPnDecLayout();
		setMainLayout();
		setPnListProcLayout();
		event();
		pack();
		setLocationRelativeTo(null);
	}

	private void event() {
		btnCertificateBrowse.addActionListener(new BtnCertificateBrowseAction(this));
		btnDecrypt.addActionListener(new BtnDecryptAction(this));
		btnEncrypt.addActionListener(new BtnEncryptAction(this));
		btnInputBrowseEnc.addActionListener(new BtnInputBrowseEncAction(this));
		btnInputCertBrowse.addActionListener(new BtnInputCertBrowseAction(this));
		btnOutputBrowseEnc.addActionListener(new BtnOutputBrowseEncAction(this));
		btnOutputCertBrowse.addActionListener(new BtnOutputCertBrowseAction(this));
		btnPrivateKeyBrowse.addActionListener(new BtnPrivateKeyBrowseAction(this));
	}

	public JButton getBtnCertificateBrowse() {
		return btnCertificateBrowse;
	}

	public void setBtnCertificateBrowse(JButton btnCertificateBrowse) {
		this.btnCertificateBrowse = btnCertificateBrowse;
	}

	public JButton getBtnDecrypt() {
		return btnDecrypt;
	}

	public void setBtnDecrypt(JButton btnDecrypt) {
		this.btnDecrypt = btnDecrypt;
	}

	public JButton getBtnEncrypt() {
		return btnEncrypt;
	}

	public void setBtnEncrypt(JButton btnEncrypt) {
		this.btnEncrypt = btnEncrypt;
	}

	public JButton getBtnInputBrowseEnc() {
		return btnInputBrowseEnc;
	}

	public void setBtnInputBrowseEnc(JButton btnInputBrowseEnc) {
		this.btnInputBrowseEnc = btnInputBrowseEnc;
	}

	public JButton getBtnInputCertBrowse() {
		return btnInputCertBrowse;
	}

	public void setBtnInputCertBrowse(JButton btnInputCertBrowse) {
		this.btnInputCertBrowse = btnInputCertBrowse;
	}

	public JButton getBtnOutputBrowseEnc() {
		return btnOutputBrowseEnc;
	}

	public void setBtnOutputBrowseEnc(JButton btnOutputBrowseEnc) {
		this.btnOutputBrowseEnc = btnOutputBrowseEnc;
	}

	public JButton getBtnOutputCertBrowse() {
		return btnOutputCertBrowse;
	}

	public void setBtnOutputCertBrowse(JButton btnOutputCertBrowse) {
		this.btnOutputCertBrowse = btnOutputCertBrowse;
	}

	public JButton getBtnPrivateKeyBrowse() {
		return btnPrivateKeyBrowse;
	}

	public void setBtnPrivateKeyBrowse(JButton btnPrivateKeyBrowse) {
		this.btnPrivateKeyBrowse = btnPrivateKeyBrowse;
	}

	public JLabel getLblCertificate() {
		return lblCertificate;
	}

	public void setLblCertificate(JLabel lblCertificate) {
		this.lblCertificate = lblCertificate;
	}

	public JLabel getLblInputCert() {
		return lblInputCert;
	}

	public void setLblInputCert(JLabel lblInputCert) {
		this.lblInputCert = lblInputCert;
	}

	public JLabel getLblInputEnc() {
		return lblInputEnc;
	}

	public void setLblInputEnc(JLabel lblInputEnc) {
		this.lblInputEnc = lblInputEnc;
	}

	public JLabel getLblOutputCertBrowse() {
		return lblOutputCertBrowse;
	}

	public void setLblOutputCertBrowse(JLabel lblOutputCertBrowse) {
		this.lblOutputCertBrowse = lblOutputCertBrowse;
	}

	public JLabel getLblOutputEnc() {
		return lblOutputEnc;
	}

	public void setLblOutputEnc(JLabel lblOutputEnc) {
		this.lblOutputEnc = lblOutputEnc;
	}

	public JLabel getLblPassword() {
		return lblPassword;
	}

	public void setLblPassword(JLabel lblPassword) {
		this.lblPassword = lblPassword;
	}

	public JLabel getLblPrivateKey() {
		return lblPrivateKey;
	}

	public void setLblPrivateKey(JLabel lblPrivateKey) {
		this.lblPrivateKey = lblPrivateKey;
	}

	public JMenu getMnHelp() {
		return mnHelp;
	}

	public void setMnHelp(JMenu mnHelp) {
		this.mnHelp = mnHelp;
	}

	public JMenuBar getMnbar() {
		return mnbar;
	}

	public void setMnbar(JMenuBar mnbar) {
		this.mnbar = mnbar;
	}

	public JMenuItem getMniAbout() {
		return mniAbout;
	}

	public void setMniAbout(JMenuItem mniAbout) {
		this.mniAbout = mniAbout;
	}

	public JMenuItem getMniHelpContents() {
		return mniHelpContents;
	}

	public void setMniHelpContents(JMenuItem mniHelpContents) {
		this.mniHelpContents = mniHelpContents;
	}

	public JPanel getPnListProcessDec() {
		return pnListProcessDec;
	}

	public void setPnListProcessDec(JPanel pnListProcessDec) {
		this.pnListProcessDec = pnListProcessDec;
	}

	public JPanel getPnListProcessEnc() {
		return pnListProcessEnc;
	}

	public void setPnListProcessEnc(JPanel pnListProcessEnc) {
		this.pnListProcessEnc = pnListProcessEnc;
	}

	public JPanel getPn_decrypt() {
		return pn_decrypt;
	}

	public void setPn_decrypt(JPanel pn_decrypt) {
		this.pn_decrypt = pn_decrypt;
	}

	public JPanel getPn_encrypt() {
		return pn_encrypt;
	}

	public void setPn_encrypt(JPanel pn_encrypt) {
		this.pn_encrypt = pn_encrypt;
	}

	public JPanel getPn_top_decrypt() {
		return pn_top_decrypt;
	}

	public void setPn_top_decrypt(JPanel pn_top_decrypt) {
		this.pn_top_decrypt = pn_top_decrypt;
	}

	public JPanel getPn_top_encrypt() {
		return pn_top_encrypt;
	}

	public void setPn_top_encrypt(JPanel pn_top_encrypt) {
		this.pn_top_encrypt = pn_top_encrypt;
	}

	public JScrollPane getScrollDec() {
		return scrollDec;
	}

	public void setScrollDec(JScrollPane scrollDec) {
		this.scrollDec = scrollDec;
	}

	public JScrollPane getScrollEnc() {
		return scrollEnc;
	}

	public void setScrollEnc(JScrollPane scrollEnc) {
		this.scrollEnc = scrollEnc;
	}

	public JTabbedPane getTabpane() {
		return tabpane;
	}

	public void setTabpane(JTabbedPane tabpane) {
		this.tabpane = tabpane;
	}

	public JTextField getTfCertificate() {
		return tfCertificate;
	}

	public void setTfCertificate(JTextField tfCertificate) {
		this.tfCertificate = tfCertificate;
	}

	public JTextField getTfInputCert() {
		return tfInputCert;
	}

	public void setTfInputCert(JTextField tfInputCert) {
		this.tfInputCert = tfInputCert;
	}

	public JTextField getTfInputEnc() {
		return tfInputEnc;
	}

	public void setTfInputEnc(JTextField tfInputEnc) {
		this.tfInputEnc = tfInputEnc;
	}

	public JTextField getTfOutputCert() {
		return tfOutputCertBrowse;
	}

	public void setTfOutputCertBrowse(JTextField tfOutputCertBrowse) {
		this.tfOutputCertBrowse = tfOutputCertBrowse;
	}

	public JTextField getTfOutputEnc() {
		return tfOutputEnc;
	}

	public void setTfOutputEnc(JTextField tfOutputEnc) {
		this.tfOutputEnc = tfOutputEnc;
	}

	public JPasswordField getTfPassword() {
		return tfPassword;
	}

	public void setTfPassword(JPasswordField tfPassword) {
		this.tfPassword = tfPassword;
	}

	public JTextField getTfPrivateKey() {
		return tfPrivateKey;
	}

	public void setTfPrivateKey(JTextField tfPrivateKey) {
		this.tfPrivateKey = tfPrivateKey;
	}

	public GridLayout getGrid_enc() {
		return grid_enc;
	}

	public void setGrid_enc(GridLayout grid_enc) {
		this.grid_enc = grid_enc;
	}

	public GridLayout getGrid_dec() {
		return grid_dec;
	}

	public void setGrid_dec(GridLayout grid_dec) {
		this.grid_dec = grid_dec;
	}

	public static void main(String args[]) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			new Main().setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
